package com.iweb.utitls;

import com.iweb.controller.UserController;

/**
 * @author ryl
 * @version 1.0
 * @data 2025/4/2 16:14
 */
public class UserLogin {

    /**
     * 主程序方法入口
     */
    public void run() throws Exception {
        UserController userController = new UserController();
        GetNumber getNumber = new GetNumber();
        while (true) {
            Menu.printMainMenu();
            int option = getNumber.getUserInputAsInt();
            switch (option) {
                case 1:
                    userController.login();
                    break;
                case 2:
                    userController.register();
                    break;
                case 3:
                    NotLogin notLogin = new NotLogin();
                    notLogin.failed();
                    break;
                case 4:
                    System.out.println("谢谢使用，再见！");
                    return;
                default:
                    System.out.println("无效选项，请重新选择....");
                    break;
            }
            System.out.println();
        }
    }

}
